Skip to content

[VL] Surface full Velox exception context in native plan validation JNI#12161

Open
Yao-MR wants to merge 2 commits into
apache:mainfrom
Yao-MR:enhancement/support_exception_jni
Open

[VL] Surface full Velox exception context in native plan validation JNI#12161
Yao-MR wants to merge 2 commits into
apache:mainfrom
Yao-MR:enhancement/support_exception_jni

Conversation

@Yao-MR
Copy link
Copy Markdown
Contributor

@Yao-MR Yao-MR commented May 28, 2026

What changes are proposed in this pull request?

PlanEvaluatorJniWrapper::nativeValidateWithFailureReason only catches
std::invalid_argument. Any other native error - including a VeloxException
thrown from inside SubstraitToVeloxPlanValidator::validate - falls through
to JNI_METHOD_END, which converts it to a Java GlutenException using only
e.what(). The JVM therefore receives the bare error message (e.g.
"duplicated rule") with no information about which component failed,
no errorSource / errorCode, no failing expression, no native stack trace.

This PR adds an explicit VeloxException catch in the JNI handler that logs
the full diagnostic context to LOG(ERROR) and then re-throws so the existing
JNI_METHOD_END path is preserved verbatim:

How was this patch tested?

mock exception and test the ut.

related ISSUE: #12141

Was this patch authored or co-authored using generative AI tooling?

@github-actions github-actions Bot added the VELOX label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant